<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@include file="/WEB-INF/webpage/common/taglibs.jspf"%>
<!DOCTYPE html>
<html>
<head>
  <title><spring:message code="sys.menu.title" /></title>
  <meta name="decorator" content="list"/>
   <script type="text/javascript" src="${staticPath }/uadmin/js/public-add.js"></script>
</head>
<body title="<spring:message code="sys.menu.title" />">
<div class="easyui-layout" fit="true" id="cc" style="width:100%;">
	<div data-options="region:'center'" title="菜单列表">
		<grid:grid id="menuGridId" async="true" treeGrid="true" gridSetting="{loadComplete:onloadFun}" sortable="true"
			multiselect="false" expandColumn="name"  sortname="sort" url="${adminPath}/sys/menu/ajaxTreeList" 
			dbUrl="${adminPath}/sys/menu/{id}" onSelectRow="selectRow">
			<grid:column label="sys.common.key" hidden="true"   name="id" />
			<grid:column label="sys.menu.name"  name="name"  query="true" condition="like"/>
			<grid:column label="sys.menu.url"  name="url"  />
		    <grid:column label="sys.menu.permission"  name="permission"  />
		    <grid:column label="sys.menu.sort"  name="sort"/>
		    <grid:column label="sys.menu.isshow"  name="isshow" dict="sf"/>
		    <grid:column label="sys.menu.isfunc"  name="isfunc" dict="sf"/>
		    <%-- <grid:column label="sys.common.opt"  name="opt" formatter="button" width="100"/>
			<grid:button   groupname="opt" function="delete" /> --%>
			<grid:toolbar  function="create_"  title="新增" icon="fa-plus" 
				btnclass="btn-fa-plus" url="${adminPath}/sys/menu/createMenu"/>
			<grid:toolbar  function="update" title="修改" icon="fa-file-text-o" 
				btnclass="btn-fa-file-text-o" url="${adminPath}/sys/menu/{id}/updateMenu"/>
			<grid:toolbar  function="delete"/>
			<grid:toolbar  function="search"/>
			<grid:toolbar  function="reset"/>
		</grid:grid>
	</div>
</div>
<script type="text/javascript">

//选中的行Id
var selectId = null;

/**
 * @description 选择行.<br>
 * @date 2018/11/8.<br>
 * @author zcg .<br>
 */
function selectRow(id){
	 selectId = id;
}

/**
 * @description 新增菜单.<br>
 * @date 2018/3/29.<br>
 * @author zcg .<br>
 */
function create_(title,url,gridId,width,height){
	url = url + '?menuId='+selectId;
	create(title,url,gridId,width,height);
}
</script>
</body>
</html>